function [activity, oris, eyes]  = getcellactivity(ExpID,roiID)

%% initialize
adata_dir = ImageAnalysis.Settings.AdataDir;

%% find the data file
[adata_file,mouse_id,date_id]=find_adata_file(ExpID,adata_dir);

if ~isempty(adata_file)
    load([adata_dir mouse_id '\' date_id '\' adata_file])
    if numel(fieldnames(ROIs)) == 0
        fprintf(2,'No ROI data in adata.')
        disp(' ')
        activity = [];
        oris = [];
        eyes = [];
    else
        %disp(['number of ROIs: ' num2str(length(ROIs))] )
        if  isfield(ROIs, 'activity')
            %disp('There is ROI activity data')
            %disp(['Load and plot ROIs: <a href="matlab: load(''' adata_dir mouse_id '\' date_id '\' adata_file ''');plot_all_ROIs_activity(ROIs)">' adata_file '</a>'])
            if (0 < roiID) && (roiID <= length(ROIs))
                activity = ROIs(roiID).activity;
                if exist('eye', 'var')
                    eyes = eye(:);
                else
                    eyes = [];
                end
                if exist('orientation', 'var')
                    oris = orientation(:);
                else
                    oris = [];
                end
            else
                fprintf(2,'This roi number does not exist.')
                disp(' ')
                activity = [];
            end
            
        else
            fprintf(2,'ROIs.activity does not exist.')
            disp(' ')
            activity = [];
        end
    end
else
    fprintf(2,'Adata file does not exist.')
    disp(' ')
    activity = [];
    oris = [];
    eyes = [];
end

%EOF












